Repository navigation
Throttle useSelect calls - #26695
Throttle useSelect calls#26695adamziel wants to merge 4 commits into
Conversation
|
The timing changes caused some tests to fail. Let's discuss this idea and I'll look into fixing the tests if it gets any traction. |
|
Size Change: +528 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
|
Cc @youknowriad. Most selectors already run async, except for the selected block's. I don't think we should delay it more than that. |
|
@ellatrix you mean the priority queue? How about only executing each selector once even if it's enqueued multiple times? |
|
See how gutenberg/packages/block-editor/src/components/block-list/index.js Lines 126 to 129 in 5f6514c Only components down the tree of the currently selected block list item are processed in real-time, everything else is updated asynchronously, and only when there are free cycles left to process those datastore updates. The number of failing e2e tests is so huge that it should be a good indicator that it has a negative impact on the writing flow. In general, throttling has always been problematic when applied inside the editor. |
|
Makes sense, that's helpful feedback. I'll close this PR then. |
Description
I added a
console.logstatement toonStoreChange();and opened the post editor. Then, I typed a single letter:Uh-oh!
Then I did the same with this PR applied:
Still not perfect, but much better!
How has this been tested?
Confirm all the tests pass
Types of changes
Bugfix
Checklist: